﻿<UserControl x:Class="Tisbi.LawFirm.UI.Views.Controls.LawsuitGreed"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mui="http://firstfloorsoftware.com/ModernUI"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="600">
    <Grid DataContext="{Binding Source={StaticResource Locator}, Path=LawsuitsViewModel}">
        <Grid.Background>
            <SolidColorBrush Color="{DynamicResource {x:Static SystemColors.InactiveBorderColorKey}}"/>
        </Grid.Background>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="50" MaxWidth="50" />
            <ColumnDefinition Width="50" MaxWidth="50" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <mui:ModernButton Command="{Binding CreateCommand}" Grid.Row="0" Grid.Column="0" EllipseDiameter="22" HorizontalAlignment="Left" EllipseStrokeThickness="2" IconWidth="12" IconHeight="12" ToolTip="Добавить" IconData="{StaticResource AddIconData}" Width="34" />
        <mui:ModernButton Command="{Binding EditCommand}"  Grid.Row="0" Grid.Column="1" EllipseDiameter="22" HorizontalAlignment="Left" EllipseStrokeThickness="2" IconWidth="12" IconHeight="12" ToolTip="Редактировать" IconData="{StaticResource EditIconData}" Width="34" />
        <mui:ModernButton Command="{Binding RemoveCommand}" Grid.Row="0" Grid.Column="2" EllipseDiameter="22" HorizontalAlignment="Left" EllipseStrokeThickness="2" IconWidth="12" IconHeight="12" ToolTip="Удалить" IconData="{StaticResource RemoveIconData}" Width="34" />
        <!--<mui:BBCodeBlock Visibility="{Binding HasVarnings}" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Foreground="Red" Margin="5" BBCode="{Binding Varnings}" />-->

        <StackPanel Grid.Row="1" Grid.ColumnSpan="3" Grid.Column="0" >
            <ScrollViewer>
                <StackPanel>
                    <DataGrid AutoGenerateColumns="False" IsReadOnly="True" ItemsSource="{Binding Model}" SelectedItem="{Binding SelectedModelItem, Mode=TwoWay}">
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=Id}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="№" />
                            <DataGridTextColumn Binding="{Binding Path=Number}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Номер" />
                            <DataGridTextColumn Binding="{Binding Path=Created}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Дата создания" />
                            <DataGridTextColumn Binding="{Binding Path=CourtType.CourtTypeTitle}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Тип иска" />
                            <DataGridTextColumn Binding="{Binding Path=District.Title}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Федеральный округ" />
                            <DataGridTextColumn Binding="{Binding Path=Plaintiff.Title}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Истец" />
                            <DataGridTextColumn Binding="{Binding Path=Defendant.Title}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Ответчик" />
                            <DataGridTextColumn Binding="{Binding Path=ThirdParties.Title}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Третьи лица" />
                            <DataGridTextColumn Binding="{Binding Path=StatementOfClaimType.StatementOfClaimTypeTitle}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="StatementOfClaimTypes" />
                            <DataGridTextColumn Binding="{Binding Path=ContentRequirements}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Содержание требований" />
                            <DataGridTextColumn Binding="{Binding Path=PrincipalDebt}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Сумма основного долга" />
                            <DataGridTextColumn Binding="{Binding Path=LatePaymentCharge}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Сумма пени" />
                            <DataGridTextColumn Binding="{Binding Path=ClaimAmount}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Сумма иска" />
                            <DataGridTextColumn Binding="{Binding Path=NationalDuty}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Госпошлина" />
                            <DataGridTextColumn Binding="{Binding Path=Outcome}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Решение" />
                            <DataGridTextColumn Binding="{Binding Path=OutcomeAmount}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Сумма выплаты" />
                            <DataGridTextColumn Binding="{Binding Path=Court.Title}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Суд" />
                            <DataGridTextColumn Binding="{Binding Path=CourtCaseNumber}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Номер дела в суде" />
                            <DataGridTextColumn Binding="{Binding Path=ContactsOfJudge}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Контакты судьи" />
                            <DataGridTextColumn Binding="{Binding Path=HearingDate}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Дата слушания" />
                            <DataGridTextColumn Binding="{Binding Path=LocationCaseMaterials.Title}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Место нахождения дела" />
                            <DataGridTextColumn Binding="{Binding Path=DateOfDecision}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Дата решения" />
                            <DataGridTextColumn Binding="{Binding Path=ResultOfDecision}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Содержание решения" />
                            <DataGridTextColumn Binding="{Binding Path=Appeals.Count}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Апеляции" />
                        </DataGrid.Columns>
                    </DataGrid>
                </StackPanel>
            </ScrollViewer>
        </StackPanel>
    </Grid>
</UserControl>
